package com.example.bit.spring_ioc_demo.DemoUserInfo;

import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Component
public class InputUser {
    @Bean//要配合类注解使用
    public UserInfo putUser1(){
        UserInfo user1=new UserInfo(1,"张三");
        return user1;
    }
    @Bean
    public UserInfo putUser2(){
        UserInfo user2=new UserInfo(2,"李四");
        return user2;
    }

    @Bean(name="putUser3")
    public UserInfo putUser(){
        UserInfo user3=new UserInfo(3,"王五");
        return user3;
    }
}
